﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="volva.Services" %>
<%
    if (Request.IsAuthenticated) {
    int newMessageCount = MessageService.GetNewMessageCount(AccountService.GetUserIDByName(Page.User.Identity.Name));

%>
        Velkomin(n) <b><%= Html.Encode(Page.User.Identity.Name) %></b>!
        [ <%= Html.ActionLink("Útskrá", "LogOff", "Account") %> ] <br />
        <%
            Response.Write("<a href='/Account/Messages/'>Þú átt " + newMessageCount + " ólesin skilaboð</a><br />");
            Response.Write("<a href='/Station/Create/'>Stofna sjónvarpsstöð</a><br />");
            Response.Write("<a href='/Account/Settings/'>Breyta stillingum</a>");
    }
    else {
        using (Html.BeginForm("LogOn","Account"))
    	{
%>
        <div class="inputs">
		<label for="UserName">Notendanafn</label>
		<input type="text" id="UserName" name="UserName" class="text" />
		<label for="Password">Password</label>
		<input type="password" id="Password" name="Password" class="text" />
	    </div>
	    <a href="/Account/Register">Nýskráning</a>
	    <input type="hidden" name="RememberMe" value="true" />
	    <input type="submit" value="Innskrá" class="btn" /> 
<%
	}
    }
%>
